import json
from multiprocessing import Process


def get_ticket(username):
    """查询余票"""
    with open("ticket.txt", "r") as f:
        data = json.load(f)
        print(f"{username}查询余票：{data['count']}")


if __name__ == '__main__':
    for i in range(10):
        p = Process(target=get_ticket, args=(f"user-{i}",))
        p.start()
